using System;
using System.Windows.Forms;
using System.Collections.Generic;

namespace FreeFlowAdministrator
{
	/// <summary>
	/// Summary description for Adaptor.
	/// </summary>
	public abstract class Adaptor
	{
    public virtual void AddChildren(TreeNode node)
    {
      // by default, do nothing
    }

    public virtual Control GetRenderer()
    {
      return null;
    }

    public virtual int ImageIndex
    {
      get
      {
        return 0;
      }
    }

    public abstract string Text
    {
      get;
    }

    public abstract object Object
    {
      get;
    }

    public event EventHandler ItemDeleted;
    protected void TriggerItemDeleted(object sender, EventArgs e)
    {
      if (ItemDeleted != null)
        ItemDeleted(sender, e);
    }

    public event EventHandler RefreshRequired;
    protected void TriggerRefreshRequired(object sender, EventArgs e)
    {
      if (RefreshRequired != null)
        RefreshRequired(sender, e);
    }

    public event EventHandler ItemAdded;
    protected void TriggerItemAdded(object sender, EventArgs e)
    {
      if (ItemAdded != null)
        ItemAdded(sender, e);
    }
  }
}
